<template>
  <div class>
    <naviHeader></naviHeader>
    <div class="description">
      <div>1、请进行微信实名认证后再提现，否则会提现失败</div>
      <div>2、每日提现2次， 每次2元起提</div>
      <div>3、每次提现上限2万元</div>
      <div>4、预计72小时到账，提现手续费为0.80%</div>
    </div>

    <div class="container">
      <div class="item">
        <div>账户余额（￥）</div>
        <div>{{balance}}</div>
      </div>
      <div class="item">
        <div>提现余额（￥）</div>
        <input
          class="text-right"
          v-bind:class="{exceed: number > balance}"
          v-model="number"
          type="number"
          placeholder="请输入提现余额"
        >
      </div>
    </div>

    <div class="flex-contianer">
      <div class="all-btn" v-on:click="number = balance">全部提现</div>
      <div>额外扣除 0.80%(￥0.00)手续费</div>
      <div>实际到账金额为 ￥0</div>
    </div>

    <div class="btn" v-bind:class="{banBtn: number > balance}">确定</div>
  </div>
</template>

<script>
import naviHeader from "src/components/naviHeader/naviHeader";

import { drawCash } from "../../service/getData";
export default {
  data() {
    return {
      balance: "0.00",
      number: ""
    };
  },
  
  components: {
    naviHeader
  },
  methods: {
    drawCashMethod: function() {
      if (this.number > this.balance) return;
      if (this.number <= 0) return;
      
      drawCash(this.$store.userToken, this.number).then(res => {});
    }
  }
};
</script>

<style lang="scss" scoped>
@import "../../style/mixin";
.description {
  @include sc(0.28rem, #999);
  padding: 0.3rem;
  background: #fff;
}

.container {
  background: #fff;
  margin-top: 0.2rem;

  .item {
    @include fj(space-between);
    height: 1rem;
    line-height: 1rem;
    padding: 0 0.2rem;
    border-top: 2px solid #f1f1f1;
  }

  .text-right {
    text-align: right;
  }

  .exceed {
    color: red;
  }
}

.flex-contianer {
  @include fj(space-between);

  .all-btn {
    @include sc(0.26rem, #16e08f);
  }
}

.flex-contianer > div {
  @include sc(0.26rem, #999);
  height: 0.8rem;
  line-height: 0.8rem;
}

.btn {
  width: 6rem;
  text-align: center;
  height: 0.8rem;
  line-height: 0.8rem;
  margin: 1rem auto;
  background: #16e08f;
  color: #fff;
  border-radius: 10px;
}

.banBtn{
  background: #999;
}
</style>
